// ==========  维修相关 ============//
import constant from '@/utils/constant'
import request from '@/utils/request'


/**
 * 获取维修工单池列表
 */
export function getListOwnerRepairs(data) {
    uni.showLoading({
        title: '加载中',
        mask: true,
    })
    return request({
        url: constant.getListOwnerRepairs, 
        method: 'GET',
        data
    })
}

/**
 * 获取维修工单已办
 */
export function getFinishRepairs(data) {
    uni.showLoading({
        title: '加载中',
        mask: true,
    })
    return request({
        url: constant.getFinishRepairs,
        method: 'GET',
        data
    })
}
/**
 * 获取维修工单待办
 */
export function getRepairs(data) {
    uni.showLoading({
        title: '加载中',
        mask: true,
    })
    return request({
        url: constant.getRepairs,
        method: 'GET',
        data
    })
}

/**
 * 获取维修工单-抢单
 */
export function grabbingRepair(data) {
    uni.showLoading({
        title: '加载中',
        mask: true,
    })
    return request({
        url: constant.grabbingRepair,
        method: 'POST',
        data
    })
}

/**
 * 获取维修师傅列表
 */
export function listRepairTypeUsers(data) {
    uni.showLoading({
        title: '加载中',
        mask: true,
    })
    return request({
        url: constant.listRepairTypeUsers,
        method: 'GET',
        data
    })
}

/**
 * 转单/退单/指派
 */
export function repairDispatch(data) {
    uni.showLoading({
        title: '加载中',
        mask: true,
    })
    return request({
        url: constant.repairDispatch,
        method: 'POST',
        data
    })
}

/**
 * 工单进度
 */
export function listRepairStaffs(data) {
    uni.showLoading({
        title: '加载中',
        mask: true,
    })
    return request({
        url: constant.listRepairStaffs,
        method: 'GET',
        data
    })
}

/**
 * 工单评价
 */
export function appraiseRepair(data) {
    uni.showLoading({
        title: '加载中',
        mask: true,
    })
    return request({
        url: constant.appraiseRepair,
        method: 'POST',
        data
    })
}

/**
 * 工单办结
 */
export function repairFinish(data) {
    uni.showLoading({
        title: '加载中',
        mask: true,
    })
    return request({
        url: constant.repairFinish,
        method: 'POST',
        data
    })
}

/**
 * 获取报修类型
 */
export function getRepairSettings(data) {
	uni.showLoading({
		title: '加载中',
		mask: true,
	})
	return request({
		url: constant.getRepairSettings,
		method: 'GET',
		data
	})
}

/**
 * 提交报修单
 */
export function saveOwnerRepair(data) {
	uni.showLoading({
		title: '加载中',
		mask: true,
	})
	return request({
		url: constant.saveOwnerRepair,
		method: 'POST',
		data
	})
}


